home *** CD-ROM | disk | FTP | other *** search
-
-
-
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++)))) rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++))))
-
-
-
- NNNNaaaammmmeeee
- rw_hashset - Rogue Wave library class
-
- SSSSyyyynnnnooooppppssssiiiissss
- #include <rw/rwstl/hashset.h>
- rw_hashset<T,Hash,EQ> set;
-
-
-
-
- DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
- Class rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>> maintains a collection of TTTT, implemented as a
- hash table in which there may not be more than one instance of any given
- TTTT. Since this is a vvvvaaaalllluuuueeee based collection, objects are ccccooooppppiiiieeeedddd into and
- out of the collection. As with all classes that meet the ANSI
- aaaassssssssoooocccciiiiaaaattttiiiivvvveeee ccccoooonnnnttttaaaaiiiinnnneeeerrrr specification, rrrrwwww____hhhhaaaasssshhhhsssseeeetttt provides for iterators
- that reference its elements. Operations that alter the contents of
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt may invalidate other iterators that reference the container.
- Since the contents of rrrrwwww____hhhhaaaasssshhhhsssseeeetttt are in pseudo-random order, the only
- iterator ranges that will usually make sense are the results of calling
- eeeeqqqquuuuaaaallll____rrrraaaannnnggggeeee((((kkkkeeeeyyyy)))), and the entire range from bbbbeeeeggggiiiinnnn(((()))) to eeeennnndddd(((()))).
-
- PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
- None
-
- PPPPuuuubbbblllliiiicccc TTTTyyyyppppeeeeddddeeeeffffssss
- typedef T key_type;
- typedef T value_type; // or ... "const K"
- typedef Hash key_hash;
- typedef EQ key_equal;
- typedef (unsigned) size_type; //from rw_slist
- typedef (int) difference_type; // from rw_slist
- typedef (value_type&) reference;
- typedef (const value_type&) const_reference; //from rw_slist
-
-
- Iterators over rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>> are forward iterators.
-
- typedef (scoped Iterator) iterator;
- typedef (scoped ConsIterator) const_iterator;
-
-
-
- PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>>(size_type sz = 1024,
- const Hash& h = Hash(),
- const EQ& eq = EQ());
-
-
- Construct an empty rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>> with sssszzzz slots, using hhhh as the
- hash object, and eeeeqqqq as the equality comparator.
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++)))) rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++))))
-
-
-
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>>(const rw_hashset<T,Hash,EQ>& set);
-
-
- Construct an rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>> which is a copy of sssseeeetttt. Each element
- from sssseeeetttt will be copied into self.
-
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>>(const_iterator first,
- const_iterator bound
- size_type sz=1024,
- const Hash& h = Hash(),
- const EQ& eq = EQ());
-
-
- Construct an rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>> with sssszzzz slots, using hhhh as the hash
- object, and eeeeqqqq as the equality comparator, containing a copy of each item
- referenced by the range starting with ffffiiiirrrrsssstttt and bounded by bbbboooouuuunnnndddd.
-
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>>(const value_type* first,
- const value_type* bound
- size_type sz=1024,
- const Hash& h = Hash(),
- const EQ& eq = EQ());
-
-
- Construct an rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>> with sssszzzz slots, using hhhh as the hash
- object, and eeeeqqqq as the equality comparator, containing a copy of each item
- referenced by the range starting with ffffiiiirrrrsssstttt and bounded by bbbboooouuuunnnndddd. If
- there are items in the range which test EEEEQQQQ, then only the first such item
- will be inserted into self.
-
- PPPPuuuubbbblllliiiicccc DDDDeeeessssttttrrrruuuuccccttttoooorrrr
- ~~~~rrrrwwww____hhhhaaaasssshhhhsssseeeetttt<<<<TTTT,,,,HHHHaaaasssshhhh,,,,EEEEQQQQ>>>>();
-
-
- The destructor releases the memory used by the container's
- implementation.
-
- PPPPuuuubbbblllliiiicccc OOOOppppeeeerrrraaaattttoooorrrrssss
- rw_hashset<T,Hash,EQ>&
- ooooppppeeeerrrraaaattttoooorrrr====(const rw_hashset<T,Hash,EQ>& rhs);
-
-
- Sets self to have the same capacity, HHHHaaaasssshhhh and EEEEQQQQ as rrrrhhhhssss, removes all
- self's current contents, and replaces them with copies of the elements in
- rrrrhhhhssss.
-
- bool
- ooooppppeeeerrrraaaattttoooorrrr========(const rw_hashset<T,Hash,EQ> & rhs) const;
-
-
- Returns true if self and rrrrhhhhssss have the same number of elements, and for
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++)))) rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++))))
-
-
-
- each item in self there is an item in rrrrhhhhssss which tests EEEEQQQQ.
-
- AAAAcccccccceeeessssssssoooorrrrssss
- iterator
- bbbbeeeeggggiiiinnnn();
-
-
- The iterator returned references the first item in self. If self is
- empty, the iterator is equal to eeeennnndddd(((()))). Note that because items are
- stored in pseudo-random order, this iterator might reference any item
- that has been stored in self.
-
- const_iterator
- bbbbeeeeggggiiiinnnn() const;
-
-
- The iterator returned references the first item in self. If self is
- empty, the iterator is equal to eeeennnndddd(((()))). Note that because items are
- stored in pseudo-random order, this iterator might reference any item
- that has been stored in self.
-
- iterator
- eeeennnndddd();
-
-
- The iterator returned marks the location "off the end" of self. It may
- not be dereferenced.
-
- const_iterator
- eeeennnndddd() const;
-
-
- The iterator returned marks the location "off the end" of self. It may
- not be dereferenced.
-
- pair<const_iterator, const_iterator>
- eeeeqqqquuuuaaaallll____rrrraaaannnnggggeeee(const key_type key) const;
-
-
- Returns ppppaaaaiiiirrrr<<<<ccccoooonnnnsssstttt____iiiitttteeeerrrraaaattttoooorrrr,,,, ccccoooonnnnsssstttt____iiiitttteeeerrrraaaattttoooorrrr>>>>((((lllloooowwwweeeerrrr____bbbboooouuuunnnndddd((((kkkkeeeeyyyy)))),,,,
- uuuuppppppppeeeerrrr____bbbboooouuuunnnndddd((((kkkkeeeeyyyy)))))))). Upper and lower bound have special meaning for hash-
- based collections. See discussion elsewhere.
-
- pair<iterator, iterator>
- eeeeqqqquuuuaaaallll____rrrraaaannnnggggeeee(const key_type key);
-
-
- Returns ppppaaaaiiiirrrr<<<<iiiitttteeeerrrraaaattttoooorrrr,,,,iiiitttteeeerrrraaaattttoooorrrr>>>>((((lllloooowwwweeeerrrr____bbbboooouuuunnnndddd((((kkkkeeeeyyyy)))),,,, uuuuppppppppeeeerrrr____bbbboooouuuunnnndddd((((kkkkeeeeyyyy)))))))).
- Upper and lower bound have special meaning for hash-based collections.
- See discussion elsewhere.
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-
-
-
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++)))) rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++))))
-
-
-
- onst_iterator
- lllloooowwwweeeerrrr____bbbboooouuuunnnndddd(const key_type& key) const;
-
-
- Returns the lower bound of kkkkeeeeyyyy in self. This has a special meaning for
- hash-based collections. See discussion elsewhere.
-
- iterator
- lllloooowwwweeeerrrr____bbbboooouuuunnnndddd(const key_type& key);
-
-
- Returns the lower bound of kkkkeeeeyyyy in self. This has a special meaning for
- hash-based collections. See discussion elsewhere.
-
- const_iterator
- uuuuppppppppeeeerrrr____bbbboooouuuunnnndddd(const key_type& key) const;
-
-
- Returns the upper bound of kkkkeeeeyyyy in self. This has a special meaning for
- hash-based collections. See discussion elsewhere.
-
- iterator
- uuuuppppppppeeeerrrr____bbbboooouuuunnnndddd(const key_type& key);
-
-
- Returns the upper bound of kkkkeeeeyyyy in self. This has a special meaning for
- hash-based collections. See discussion elsewhere.
-
- CCCCoooonnnnsssstttt PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
- size_type
- ccccaaaappppaaaacccciiiittttyyyy() const;
-
-
- Returns the number of slots in the hash table that self uses.
-
- bool
- eeeemmmmppppttttyyyy() const;
-
-
- Returns ttttrrrruuuueeee if self is empty.
-
- float
- ffffiiiillllllll____rrrraaaattttiiiioooo() const;
-
-
- Returns the result of calculating ssssiiiizzzzeeee(((())))////ccccaaaappppaaaacccciiiittttyyyy(((()))).
-
- size_type
- ssssiiiizzzzeeee() const;
-
-
-
-
-
-
- PPPPaaaaggggeeee 4444
-
-
-
-
-
-
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++)))) rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++))))
-
-
-
- Returns the number of items currently held in self.
-
- MMMMuuuuttttaaaattttoooorrrrssss
- void
- cccclllleeeeaaaarrrr();
-
-
- A synonym for eeeerrrraaaasssseeee((((bbbbeeeeggggiiiinnnn(((()))),,,,eeeennnndddd(((())))))));;;;
-
- size_type
- eeeerrrraaaasssseeee(const key_type& key);
-
-
- If there is an item EEEEQQQQ to kkkkeeeeyyyy, it is removed, and 1111 is returned.
- Otherwise, 0000 is returned.
-
- iterator
- eeeerrrraaaasssseeee(iterator iter);
-
-
- Removes the element referenced by iiiitttteeeerrrr and returns an iterator
- referencing the "next" element. If iiiitttteeeerrrr does not reference an item in
- self, the result is undefined.
-
- iterator
- eeeerrrraaaasssseeee(iterator first, iterator bound);
-
-
- Removes each element in the range which begins with ffffiiiirrrrsssstttt and is bounded
- by bbbboooouuuunnnndddd. Returns an iterator referencing bbbboooouuuunnnndddd. If ffffiiiirrrrsssstttt does not
- reference an item in self (and if ffffiiiirrrrsssstttt and bbbboooouuuunnnndddd are not equal), the
- effect is undefined.
-
- pair<iterator,bool>
- iiiinnnnsssseeeerrrrtttt(const value_type& val);
-
-
- If there is no item in self EEEEQQQQ to vvvvaaaallll then inserts vvvvaaaallll, returning a pair
- with an iterator referencing the new element and true. Otherwise,
- returns a pair with an iterator referencing the matching vvvvaaaalllluuuueeee____ttttyyyyppppeeee and
- false.
-
- size_type
- iiiinnnnsssseeeerrrrtttt(iterator ignore, const value_type& val);
-
-
- If there is no item in self EEEEQQQQ to vvvvaaaallll then inserts vvvvaaaallll, returning 1111.
- Otherwise, does nothing and returns 0000. Note that the first argument is
- provided only for conformance with the ANSI aaaassssssssoooocccciiiiaaaattttiiiivvvveeee ccccoooonnnnttttaaaaiiiinnnneeeerrrr
- specification, and is ignored by the method, since hash table look up can
- be done in constant time.
-
-
-
-
- PPPPaaaaggggeeee 5555
-
-
-
-
-
-
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++)))) rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++))))
-
-
-
- size_type
- iiiinnnnsssseeeerrrrtttt(const value_type* first, const value_type* bound);
-
-
- For each element in the range beginning with ffffiiiirrrrsssstttt and bounded by bbbboooouuuunnnndddd,,,,
- if there is no item in self EEEEQQQQ to that element, the element is copied
- into self, or if there is such an element, it is skipped. Returns the
- number of elements inserted.
-
- size_type
- iiiinnnnsssseeeerrrrtttt(const_iterator first, const_iterator bound);
-
-
- For each element in the range beginning with ffffiiiirrrrsssstttt and bounded by bbbboooouuuunnnndddd,,,,
- if there is no item in self EEEEQQQQ to that element, the element is copied
- into self, or if there is such an element, it is skipped. Returns the
- number of elements inserted.
-
- void
- sssswwwwaaaapppp(rw_hashset<T,Hash,EQ>& other);
-
-
- Exchanges the contents of self with ooootttthhhheeeerrrr including the HHHHaaaasssshhhh and EEEEQQQQ
- objects. This method does not copy or destroy any of the items exchanged
- but exchanges the underlying hash tables.
-
- SSSSppppeeeecccciiiiaaaallll MMMMeeeetttthhhhooooddddssss ffffoooorrrr SSSSeeeettttssss
- size_type
- ccccoooouuuunnnntttt(const key_type& key) const;
-
-
- Returns 1111 if self contains kkkkeeeeyyyy, else 0000.
-
- const_iterator
- ffffiiiinnnndddd(const key_type& key) const;
-
-
- Returns a const_iterator referencing kkkkeeeeyyyy, if it is contained in self,
- else returns eeeennnndddd(((()))).
-
- iterator
- ffffiiiinnnndddd(const key_type& key);
-
-
- Returns an iterator referencing kkkkeeeeyyyy, if it is contained in self, else
- returns eeeennnndddd(((()))).
-
- void
- rrrreeeessssiiiizzzzeeee(size_type sz);
-
-
- Resizes self's hash table to have sssszzzz slots; and re-hashes all self's
-
-
-
- PPPPaaaaggggeeee 6666
-
-
-
-
-
-
- rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++)))) rrrrwwww____hhhhaaaasssshhhhsssseeeetttt((((3333CCCC++++++++))))
-
-
-
- elements into the new table. Can be very expensive if self holds many
- elements.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 7777
-
-
-
-